package com.zbkj.admin.controller;

import com.zbkj.admin.service.AdminProjectStatisHandlerService;
import com.zbkj.common.request.project.AdminProjectStatisRequest;
import com.zbkj.common.response.CommonResult;
import com.zbkj.common.response.project.AdminProjectStatisResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Auther:
 * @Date: 2024/8/7 17:48
 * @Description:
 */
@Slf4j
@RestController
@RequestMapping("api/admin/statis")
@Api(tags = "服务端统计管理服务")
public class AdminStatisController {

    @Autowired
    private AdminProjectStatisHandlerService adminProjectStatisHandlerService;

    @ApiOperation(value="项目按天统计")
    @PostMapping("/prjectStatisDay")
    public CommonResult<List<AdminProjectStatisResponse>> prjectStatisDay(@RequestBody AdminProjectStatisRequest paramRequest) {
        List<AdminProjectStatisResponse> resultList = adminProjectStatisHandlerService.prjectStatisDay(paramRequest);
        return CommonResult.success(resultList);
    }

    @ApiOperation(value="项目按月统计")
    @PostMapping("/prjectStatisMonth")
    public CommonResult<List<AdminProjectStatisResponse>> prjectStatisMonth(@RequestBody AdminProjectStatisRequest paramRequest) {
        List<AdminProjectStatisResponse> resultList = adminProjectStatisHandlerService.prjectStatisMonth(paramRequest);
        return CommonResult.success(resultList);
    }
}
